package cn.iocoder.yudao.module.project.dal.mysql.kismaterielexwarehousehistory;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.project.dal.dataobject.kismaterielexwarehousehistory.KisMaterielExWarehouseHistoryDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.project.controller.admin.kismaterielexwarehousehistory.vo.*;

/**
 * 物料出库单历史数据 Mapper
 *
 * @author 武汉华诚
 */
@Mapper
public interface KisMaterielExWarehouseHistoryMapper extends BaseMapperX<KisMaterielExWarehouseHistoryDO> {

    default PageResult<KisMaterielExWarehouseHistoryDO> selectPage(KisMaterielExWarehouseHistoryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<KisMaterielExWarehouseHistoryDO>()
                .eqIfPresent(KisMaterielExWarehouseHistoryDO::getOrderCode, reqVO.getOrderCode())
                .eqIfPresent(KisMaterielExWarehouseHistoryDO::getExCode, reqVO.getExCode())
                .eqIfPresent(KisMaterielExWarehouseHistoryDO::getType, reqVO.getType())
                .eqIfPresent(KisMaterielExWarehouseHistoryDO::getExNum, reqVO.getExNum())
                .eqIfPresent(KisMaterielExWarehouseHistoryDO::getOperator, reqVO.getOperator())
                .betweenIfPresent(KisMaterielExWarehouseHistoryDO::getExTime, reqVO.getExTime())
                .eqIfPresent(KisMaterielExWarehouseHistoryDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(KisMaterielExWarehouseHistoryDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(KisMaterielExWarehouseHistoryDO::getId));
    }




    Integer selectExNumByOrderCode(Map<String, Object> params);
    Integer selectExNumByOrderCodeAndType(Map<String, Object> params);
    Integer selectExCodeNumByOrderCode(Map<String, Object> params);
    Integer selectExNumByExCode(Map<String, Object> params);

}